home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / StdAfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2011-11-06  |  4.9 KB  |  207 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // stdafx.h : Include-Datei fⁿr Standard-System-Include-Dateien,
  20. //  oder projektspezifische Include-Dateien, die hΣufig benutzt, aber
  21. //      in unregelmΣ▀igen AbstΣnden geΣndert werden.
  22. //
  23.  
  24. #if !defined(AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_)
  25. #define AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_
  26.  
  27. #if _MSC_VER > 1000
  28. #pragma once
  29. #endif // _MSC_VER > 1000
  30.  
  31. #define WIN32_LEAN_AND_MEAN        // Selten verwendete Teile der Windows-Header nicht einbinden
  32.  
  33. #pragma warning (disable : 4786)
  34.  
  35. #include <windows.h>
  36. #include <crtdbg.h>
  37. #include <stddef.h>
  38.  
  39. #include <wtypes.h>
  40. #include <oleauto.h>
  41. #include "atlconv.h"
  42.  
  43. #include "shlobj.h"
  44.  
  45. #include "config.h"
  46.  
  47. #include "misc\stdstring.h"
  48.  
  49. #include "MFC64bitFix.h"
  50. #include <map>
  51. #include <list>
  52. #include <vector>
  53. #include <set>
  54.  
  55. #ifdef MMGR
  56. #include "misc/mmgr.h"
  57. #endif
  58.  
  59. #include "conversion.h"
  60.  
  61. #include "AsyncSocketEx.h"
  62.  
  63. #define FILEZILLA_SERVER_MESSAGE _T("FileZilla Server Message")
  64. #define FILEZILLA_THREAD_MESSAGE _T("FileZilla Thread Message")
  65.  
  66. const UINT WM_FILEZILLA_RELOADCONFIG = WM_APP;
  67. const UINT WM_FILEZILLA_SERVERMSG = (WM_APP + 1);
  68. const UINT WM_FILEZILLA_THREADMSG = ::RegisterWindowMessage(FILEZILLA_THREAD_MESSAGE);
  69.  
  70. #define FSM_STATUSMESSAGE 0
  71. #define FSM_CONNECTIONDATA 1
  72. #define FSM_THREADCANQUIT 2
  73. #define FSM_SEND 3
  74. #define FSM_RECV 4
  75.  
  76. #define FTM_NEWSOCKET 0
  77. #define FTM_DELSOCKET 1
  78. #define FTM_COMMAND 2
  79. #define FTM_TRANSFERMSG 3
  80. #define FTM_GOOFFLINE 4
  81. #define FTM_CONTROL 5
  82. #define FTM_NEWSOCKET_SSL 6
  83. #define FTM_HASHRESULT 7
  84.  
  85. #define USERCONTROL_GETLIST 0
  86. #define USERCONTROL_CONNOP 1
  87. #define USERCONTROL_KICK 2
  88. #define USERCONTROL_BAN 3
  89.  
  90. #define USERCONTROL_CONNOP_ADD 0
  91. #define USERCONTROL_CONNOP_CHANGEUSER 1
  92. #define USERCONTROL_CONNOP_REMOVE 2
  93. #define USERCONTROL_CONNOP_TRANSFERINIT 3
  94. #define USERCONTROL_CONNOP_TRANSFEROFFSETS 4
  95.  
  96. typedef struct
  97. {
  98.     int command;
  99.     int socketid;
  100. } t_controlmessage;
  101.  
  102. typedef struct
  103. {
  104.     TCHAR ip[40];
  105.     LPTSTR user;
  106.     SYSTEMTIME time;
  107.     UINT userid;
  108.     int type;
  109.     LPTSTR status;
  110. } t_statusmsg;
  111.  
  112. class CServerThread;
  113. typedef struct
  114. {
  115.     int userid;
  116.     
  117.     // Set only by USERCONTROL_CONNOP_CHANGEUSER messages
  118.     CStdString user;
  119.  
  120.     // Set only by USERCONTROL_CONNOP_ADD messages
  121.     TCHAR ip[40];
  122.     unsigned int port;
  123.     CServerThread *pThread;
  124.  
  125.     // Set only by USERCONTROL_CONNOP_TRANSFERINFO messages
  126.     unsigned char transferMode;
  127.     CStdString physicalFile;
  128.     CStdString logicalFile;
  129.     __int64 currentOffset;
  130.     __int64 totalSize;
  131. } t_connectiondata;
  132.  
  133. struct t_connectiondata_add
  134. {
  135.     TCHAR ip[40];
  136.     unsigned int port;
  137.     CServerThread *pThread;
  138. };
  139.  
  140. struct t_connectiondata_changeuser
  141. {
  142.     CStdString user;
  143. };
  144.  
  145. struct t_connectiondata_transferinfo
  146. {
  147.     unsigned char transferMode;
  148.     CStdString physicalFile;
  149.     CStdString logicalFile;
  150.     __int64 startOffset;
  151.     __int64 totalSize;
  152. };
  153.  
  154. struct t_connectiondata_transferoffsets
  155. {
  156.     unsigned char* pData;
  157.     int len;
  158. };
  159.  
  160. typedef struct
  161. {
  162.     void *data;
  163.     int op;
  164.     int userid;
  165. } t_connop;
  166.  
  167. extern HWND hMainWnd;
  168. #ifndef CCRITICALSECTIONWRAPPERINCLUDED
  169. class CCriticalSectionWrapper
  170. {
  171. public:
  172.     CCriticalSectionWrapper();
  173.     ~CCriticalSectionWrapper();
  174.     
  175.     void Lock();
  176.     void Unlock();
  177.  
  178. #ifndef DEADLOCKDEBUG
  179. protected:
  180. #else
  181. public:
  182. #endif
  183.     CRITICAL_SECTION m_criticalSection;
  184.     BOOL m_bInitialized;
  185. #ifdef DEBUG
  186.     int m_lockCount;
  187. #endif
  188.  
  189. };
  190. #define CCRITICALSECTIONWRAPPERINCLUDED
  191. #endif
  192.  
  193. #ifndef DEADLOCKDEBUG
  194. #define EnterCritSection(section) section.Lock()
  195. #define LeaveCritSection(section) section.Unlock()
  196. #else
  197. void EnterCritSectionDebug(CCriticalSectionWrapper §ion, const char *pFile, int line);
  198. void LeaveCritSectionDebug(CCriticalSectionWrapper §ion, const char *pFile, int line);
  199. #define EnterCritSection(section) EnterCritSectionDebug(section, __FILE__, __LINE__)
  200. #define LeaveCritSection(section) LeaveCritSectionDebug(section, __FILE__, __LINE__)
  201. #endif
  202.  
  203. //{{AFX_INSERT_LOCATION}}
  204. // Microsoft Visual C++ fⁿgt unmittelbar vor der vorhergehenden Zeile zusΣtzliche Deklarationen ein.
  205.  
  206. #endif // !defined(AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_)
  207.